<script setup>
import { computed } from 'vue'
import { useRouter } from 'vue-router'

import { login } from '@/services'

// 动态路由获取
const router = useRouter()
const routes = computed(() => {
  return router.currentRoute.value.matched.filter(item => item.meta.title)
})

// vant
// Toast('提示内容')

// 登陆
const toLogin = async () => {
  const loginData = await login({
    username: 'wst',
    password: '222'
  }).finally(() => {
    // alert(1)
  })
  console.log(loginData)
}

// 设备信息

</script>

<template>
  <div style="font-size: 40px;">
    {{ uaData }}
    <hr>
    <p>{{ iosver }}</p>
    <p>w:{{ w }}</p>
    <p>h:{{ h }}</p>
    <p>{{ appleVer }}</p>
    <p>{{ baseInfoVal }}</p>
  </div>
  <hr>
  <a-button type="primary">
    Primary Button
  </a-button>

  <button @click="toLogin">
    登陆
  </button>

  <img src="@/assets/vue.svg">

  <div class="logo" />

  <p class="btn">
    1
  </p>
  <hr>
  <div v-for="item in routes" :key="item.path">
    {{ item.meta.title }}
  </div>
</template>

<style scoped lang="scss">
.btn {
  display: block;
  width: 100px;
  height: 30px;
  background: aqua;
}

p {
  color: $warning-color;
}

.logo {
  width: 100px;
  height: 100px;
  background: url('@/assets/vue.svg');
}
</style>
